#!/usr/bin/env python
# -*- coding: utf-8 -*-

import sys

from PyQt4.QtCore       import *
from PyQt4.QtGui        import *
from lyricenginsogou    import LyricEngineSogou
from lyricscene         import LyricScene
from lyricviewer        import LyricViewer
from amarokcmt          import AmarokCmt
from lrcparser          import LrcParser

class LyricController(QObject):
    """
    """
    
    def __init__(self):
        """
        """
        QObject.__init__(self)

        self.lyric_scene  = LyricScene()
        self.lyric_viewer = LyricViewer(self.lyric_scene)
        self.amarok_cmt   = AmarokCmt(self.lyric_viewer)

        self.last_title  = ""
        self.last_artist = ""
        self.last_path   = ""

        self.amarok_cmt.start()

        self.lyric_viewer.resize(600, 400)

        self.lyric_viewer.show()

def main(argv):
    """
    
    Arguments:
    - `argv`:
    """
    codec = QTextCodec.codecForName("utf8")
    QTextCodec.setCodecForLocale(codec)
    QTextCodec.setCodecForCStrings(codec)

    app = QApplication(argv)

    controller = LyricController()

    sys.exit(app.exec_())

if __name__ == '__main__':
    main(sys.argv)
